package org.example.http;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SimpleHttpResponse implements HttpResponse {

    private int code;
    private String body;
    private String message;
    private Map<String, List<String>> headerFields;

    @Override
    public boolean success() {
        return code == 200 && "OK".equals(message);
    }
}
